package com.easygoods.enums;

/**
 * Created by 许崇雷 on 2019-01-14.
 */
public enum OrderTraceState {
    ToSend(0),//未发货
    UnderWay(2),//在途
    Signed(3),//已签收
    Exception(4);//异常,问题件

    private final int code; //快递鸟代码

    OrderTraceState(int code) {
        this.code = code;
    }

    public static OrderTraceState fromCode(int code) {
        for (OrderTraceState value : OrderTraceState.values()) {
            if (value.code == code)
                return value;
        }
        return null;
    }

    public int getCode() {
        return this.code;
    }
}
